For example, a scanner provided in a multi function peripherals includes a document detecting apparatus to detect the presence or absence of a document and the size of the document. The document detecting apparatus detect the presence or absence of the document based on a signal of a reflection-type or transmission-type sensor. For example, the reflection-type or transmission-type sensor projects light for detecting the presence or absence of a document onto a detection position, and detects the presence or absence of the document based on an output value obtained by converting the light received from the detection position. However, when the sensor receives stray light other than the light projected to detect the presence or absence of the document, erroneous detection on the presence or absence of the document can occur. A document detecting apparatus is desired which discriminates the stray light and can detect the presence or absence of a document at high accuracy.